package com.lg.controller;

import com.lg.api.UserServiceFacade;
import com.lg.api.result.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lg
 * @date 2021/5/3
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserServiceFacade userServiceFacade;

    @RequestMapping("/checkUserName")
    public String checkUserName(@RequestParam("userName") String userName){
        BaseResult<String> result = userServiceFacade.checkUserName(userName);
        if (result.isSuccess()){
            return "SUCCESS";
        }
        return "FAIL";
    }

    @RequestMapping("/test")
    public void test(){
        System.out.println("sss");
    }
}
